package com.tuanzi.loan.web.bean.family;

import com.google.common.collect.Lists;
import com.tuanzi.loan.business.constants.DictionaryCode;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.vo.request.family.StatNewCreditCardUvRequest;
import com.tuanzi.loan.vo.response.family.StatNewCreditCardUvResponse;
import com.tuanzi.loan.web.configuration.JSFListingBean;
import com.tuanzi.loan.web.lazy.family.StatNewCreditCardUvLazyDataModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import java.util.List;

/**
 * User: liangZongXi
 * Create time: 19:35 2018/9/6
 * Description:
 */
@Data
@Debug
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class StatNewCreditCardUvBean extends JSFListingBean<StatNewCreditCardUvRequest, StatNewCreditCardUvResponse> {
    private static final long serialVersionUID = -2250764204994416300L;

    @PostConstruct
    public void init(){
        initLazyDataModel();
    }

    private void initLazyDataModel() {
        $ = new StatNewCreditCardUvRequest();
        lazyDataModel = new StatNewCreditCardUvLazyDataModel($);
    }

    public void onRest(){
        initLazyDataModel();
    }

    @Override
    protected List<String> getDictionaryCodes() {
        return Lists.newArrayList(DictionaryCode.NEW_CREDIT_CARD_ADVERT);
    }
}
